from pydantic_settings import BaseSettings
from pydantic import Field

class Settings(BaseSettings):
    DATABASE_URL: str = Field(default="sqlite+aiosqlite:///./test.db")
    JWT_SECRET: str = Field(default="your_super_secret_key_here")
    ALGORITHM: str = Field(default="HS256")
    ACCESS_TOKEN_EXPIRE_MINUTES: int = Field(default=30)
    OPENAI_API_KEY: str | None = Field(default=None)
    IMAGE_GEN_MODEL: str = Field(default="gpt-4o-image-vip")

    # Optional Email settings
    SMTP_HOST: str | None = Field(default="smtp.163.com")
    SMTP_PORT: int | None = Field(default=465)
    SMTP_USER: str | None = Field(default="san_san12341@163.com")
    SMTP_PASSWORD: str | None = Field(default="BZREUGNTJKHJBHCY")
    EMAILS_FROM_EMAIL: str | None = Field(default="san_san12341@163.com")

    class Config:
        env_file = '.env'
        env_file_encoding = 'utf-8'
        extra = 'ignore' # Ignore extra fields from .env

settings = Settings()
